<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | General Form Elements</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/adminlte/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/adminlte/css/skins/_all-skins.min.css}">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content">
    <!-- Horizontal Form -->
    <div class="box">
        <div class="box-header with-border">
            <h3 class="box-title">规格详情</h3>
        </div>
        <!-- /.box-header -->
        <!-- form start -->
        <div class="form-horizontal">
            <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-4 control-label">类型名</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" th:field="${specification.typeName}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">商品图片</label>

                    <div class="col-sm-4">
                        <img th:src="'/myFile/img/specificationPic/' + ${specification.picLink}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">价格</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" th:field="${specification.price}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">freight</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" th:field="${specification.freight}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">运输方式</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" th:field="${specification.shippingMethod}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">库存</label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" th:field="${specification.inventory}">
                    </div>
                </div>
            </div>
            <!-- /.box-body -->
            <div class="box-footer">
                <div class="col-sm-4"></div>
                <div class="col-sm-4">
                    <form th:id="${specification.id}">
                        <input type="text" name="id" th:value="${specification.id}" hidden="hidden" />
                        <input type="text" name="commodityId" th:value="${specification.commodityId}" hidden="hidden" />
                        <button class="btn btn-info" type="submit" th:onclick="'up('+${specification.id}+')'">修改</button>
                        <button class="btn btn-danger pull-right" type="submit" th:onclick="'del('+${specification.id}+')'" >删除</button>
                    </form>
                </div>
            </div>
            <!-- /.box-footer -->
        </div>
    </div>
    <!-- /.box -->
</section>

<script>
    function up(i) {
        document.getElementById(i).action="/Specification/goToAddPage";
        document.getElementById(i).submit();
    }
    function  del(i) {
        document.getElementById(i).action="/Specification/deleteSpecification?id=" + i;
        document.getElementById(i).submit();
    }
</script>

<!-- jQuery 3 -->
<script th:src="@{/adminlte/bower_components/jquery/dist/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
<!-- FastClick -->
<script th:src="@{/adminlte/bower_components/fastclick/lib/fastclick.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/adminlte/js/adminlte.min.js}"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/adminlte/js/demo.js}"></script>
</body>
</html>